﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MerchantCar.aspx.cs" Inherits="carinsurance_merchant_MerchantCar" EnableEventValidation="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
    <title>Merchant Car - GG-CRM - กล้วยๆ.com - Teledirect Thailand</title>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitle" runat="Server">
    <table width="100%" cellpadding="5">
        <tr>
            <td style="width: 800px">
                <h1>
                    <asp:Label runat="server" Text="Merchant Car" ID="lblPageName"></asp:Label>
                    <asp:Label runat="server" Text="" ID="lblCallTypeDesc"></asp:Label></h1>
            </td>
            <td style="width: 200px; text-align: right;">
                <asp:Button runat="server" ID="btnQuote" Text="MANUAL QUOTE" Visible="true" OnClick="btnQuote_Click"
                    Width="121px" Height="30px" Font-Bold="true" ValidationGroup="none" CausesValidation="false"
                    OnClientClick="return BackConfirm();" CssClass="blueB ml10" />&nbsp;
            </td>
            <td style="text-align: right">
                <asp:Button runat="server" ID="btnReset" Text="Reset/Reload" Visible="true" OnClick="btnReset_Click"
                    Width="121px" Height="30px" Font-Bold="true" ValidationGroup="none" CausesValidation="false"
                    OnClientClick="return ResetConfirm();" CssClass="blueB ml10" />
                <asp:Label runat="server" Text="0" ID="lblResetUrl" Visible="false" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" Text="<%$Resources:General,LangOption%>" Visible="false"
        ID="lblLangOption" />
    <asp:Label runat="server" Visible="false" ID="lblRenewalStatus" Text="0" />
    <div class="bc2">
        <asp:Label runat="server" ID="lblSiteLocation" Text="You are here : " CssClass="bclist" />
        <asp:SiteMapPath SiteMapProvider="SiteUserSiteMapProvider" ID="smpProvider" runat="server"
            PathSeparator=" : ">
            <PathSeparatorStyle CssClass="bcarrow" />
            <CurrentNodeStyle CssClass="bclist" />
            <NodeStyle CssClass="bclink" />
            <RootNodeStyle CssClass="bclink" />
        </asp:SiteMapPath>
        <div class="clear">
        </div>
    </div>
    <div style="display: none;">
        <img src="../../images/icons/dark/call.png" alt="" class="titleIcon" /><h6>
            <asp:Label ID="lblStartDayNameCaption" Font-Bold="true" runat="server" Text="<%$Resources:General,Started%>" />
            at
            <asp:Label runat="server" ID="lblStartDayName" Font-Bold="true" />
            &nbsp;<asp:Label runat="server" ID="lblStartDateTime" Visible="true" ForeColor="Red"
                Font-Bold="true" />
            <asp:Label ID="lblCallDurationCaption" Font-Bold="true" runat="server" Text="<%$Resources:General,CallDuration%>" />
            <span style="display: none;">M:<asp:TextBox runat="server" ID="txtMinute" Text="00"
                Width="30px" />
                S:<asp:TextBox runat="server" ID="txtSecond" Text="00" Width="30px" /></span>
            <asp:Label runat="server" ID="lblCallDurationTimer" Font-Bold="true" Font-Size="Large" />
        </h6>
    </div>
    <table class="sTable" width="100%">
        <tr>
            <td>
                <asp:Label runat="server" Text="" ID="lblCallSessionName" Font-Bold="true"></asp:Label>
                <asp:Label ID="lblTESCO200" runat="server" Font-Bold="true" ForeColor="Green" Font-Size="Large" />
            </td>
        </tr>
    </table>
    <div id="divCompany" class="toggle" runat="server">
        <div class="title opened" id="opened1">
            <img src="../../images/icons/dark/imagesList.png" alt="" class="titleIcon" />
            <h6>
                <asp:Label ID="lblLastCallStatusCaption" runat="server" Text="Merchant Car" />
                <asp:Label ID="lblLastCallStatusMessage" runat="server" Text="" ForeColor="Red" />
            </h6>
        </div>
        <div class="form">
            <fieldset class="step">
                <asp:UpdatePanel ID="upnlCar" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="pnlCar" runat="server">
                            <asp:GridView ID="grvMerchantCar" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                                Width="100%" EmptyDataText="<%$Resources:General,ErrNodata%>" CssClass="sTable"
                                GridLines="None" DataKeyNames="CarId,CECarPolicyId,RefCEUserId"
                                OnSelectedIndexChanged="grvMerchantCar_SelectedIndexChanged" OnRowCommand="grvMerchantCar_RowCommand">
                                <Columns>
                                    <asp:BoundField DataField="CarId" HeaderText="CarId" ReadOnly="True" SortExpression="CarId"
                                        ItemStyle-Width="80px" ItemStyle-Font-Bold="true" ItemStyle-ForeColor="Red" ItemStyle-HorizontalAlign="Center"
                                        ItemStyle-BorderColor="LightGray" />
                                    <asp:BoundField DataField="MakeModelDesc" ItemStyle-Width="250px" HeaderText="Make / Model"
                                        SortExpression="MakeModel">
                                        <ItemStyle Width="250px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ManufactYear" ItemStyle-Width="70px" HeaderText="Car Year"
                                        SortExpression="ManufactYear">
                                        <ItemStyle Width="70px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Insurance" HeaderText="Insurance Type" SortExpression="Insurance" />
                                    <asp:BoundField DataField="CommencementDate" ItemStyle-Width="120px" HeaderText="CommencementDate"
                                        SortExpression="CommencementDate" />
                                    <asp:BoundField DataField="QuoteDate" ItemStyle-Width="150px" HeaderText="QuoteDate"
                                        SortExpression="QuoteDate" />
                                    <asp:CommandField Visible="true" ButtonType="Button" ControlStyle-CssClass="blueB ml10"
                                        ItemStyle-HorizontalAlign="Center" HeaderText="Edit" SelectText="Edit" ShowSelectButton="true" />
                                    
                                    <asp:TemplateField HeaderText="Quote">
                                        <ItemTemplate>
                                            <asp:Button runat="server" ID="btnCar" Text="Quote" CommandName="MyQuote" CommandArgument='<%#Eval("CarId")%>'
                                                OnClientClick="javascript:return SubmitGotoCarConfirm();" CssClass="blueB ml10" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle />
                                <PagerStyle />
                                <SelectedRowStyle />
                                <HeaderStyle />
                                <EditRowStyle />
                                <AlternatingRowStyle />
                                <RowStyle />
                            </asp:GridView>
                            <div class="clear">
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </fieldset>
        </div>
    </div>
    <a id="quotenav" />
    <div class="toggle">
        <div class="title opened" id="opened2">
            <img src="../../images/icons/dark/imagesList.png" alt="" class="titleIcon" />
            <h6>
                <asp:Label ID="lblCaption" runat="server" Text="Car & Policy" />
            </h6>
        </div>
        
        <asp:Panel ID="pnlQuotes" runat="server" Visible="true">
            <div class="widgets">
                <div class="form">
                    <fieldset class="step">
                        <asp:UpdatePanel ID="upnlDetails" runat="server">
                            <ContentTemplate>
                                <div>
                                    <asp:ValidationSummary HeaderText="Opps..,please complete all(*) fields." runat="server"
                                        ValidationGroup="newmercar" ID="vsNewLeads" ShowMessageBox="false" ShowSummary="true"
                                        Font-Bold="true" />
                                    <asp:Label runat="server" ID="lblLoadMessage" Font-Bold="true" ForeColor="Red" Text="" />
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="form">
                                    <div id="divOne" class="oneTwo">
                                        <div class="toggle">
                                            <table cellpadding="0" cellspacing="0" width="100%" border="0" class="sTable">
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label6" Text="<%$Resources:General,InsuranceType%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlInsuranceType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlInsuranceType_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvInsuranceType" ControlToValidate="ddlInsuranceType"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr style="display: none;">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label5" Text="<%$Resources:Proposal,TypeofVehicle%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlVehicleType" runat="server" >
                                                            
                                                            <asp:ListItem Value="110" Text="<%$ Resources:CarInsurance,VehicleType_Private%>" />
                                                            
                                                        </asp:DropDownList>
                                                        <asp:Label Visible="false" runat="server" ID="lblModelDesc" />
                                                        <asp:Label runat="server" ID="lblCarVehicleType" Text="" Visible="false" />
                                                    </td>
                                                </tr>
                                                <tr style="display: none;">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label26" Text="<%$Resources:Proposal,SumInsured%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:UpdatePanel ID="uplSumInsured" runat="server">
                                                            <ContentTemplate>
                                                                <asp:Label runat="server" Text="<%$ Resources:CarInsurance,SumInsured%>" ID="lblSumInsuredTitle"
                                                                    Visible="false" />
                                                                <asp:Label runat="server" ID="lblSumInsured" Text="0" Visible="false" />
                                                                <div style="display: none">
                                                                    <asp:TextBox ID="txtSumInsured" MaxLength="9" Width="80px" runat="server" />
                                                                    <asp:TextBox ID="txtNewSumInsured" MaxLength="9" Width="80px" runat="server" />
                                                                    <asp:TextBox ID="txtGroupNo" Text="-1" MaxLength="2" Width="30px" runat="server" />
                                                                </div>
                                                                <asp:RequiredFieldValidator ID="rfvSumInsured" InitialValue="0" ControlToValidate="txtSumInsured"
                                                                    runat="server" ErrorMessage="" Text="" ValidationGroup="newmercar"></asp:RequiredFieldValidator>
                                                                <asp:RegularExpressionValidator ID="revSumInsured" ValidationExpression="^\d+$" ControlToValidate="txtSumInsured"
                                                                    runat="server" ErrorMessage="" Text="" ValidationGroup="newmercar"></asp:RegularExpressionValidator>
                                                                <asp:RequiredFieldValidator ID="rfvGroupNo" InitialValue="-1" ControlToValidate="txtSumInsured"
                                                                    runat="server" ErrorMessage="" Text="" ValidationGroup="newmercar"></asp:RequiredFieldValidator>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </td>
                                                </tr>
                                                <tr runat="server" id="rowGarageType">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label1" Text="<%$Resources:Proposal,GarageType%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlGarageType" runat="server">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvGarageType" ControlToValidate="ddlGarageType"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label2" Text="<%$Resources:Proposal,CarYear%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlCarYear" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCarYear_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCarYear" ControlToValidate="ddlCarYear"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label3" Text="<%$Resources:CarInsurance,CarMake%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList runat="server" ID="ddlCarMake" Width="250px" AutoPostBack="true"
                                                            OnSelectedIndexChanged="ddlCarMake_SelectedIndexChanged">
                                                            <asp:ListItem Value="-1" Text="<%$ Resources:General,Select%>"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCarMake" ControlToValidate="ddlCarMake"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label27" Text="<%$Resources:Proposal,CarModel%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList runat="server" ID="ddlModelBodyCCDoor" Width="250px" AutoPostBack="True"
                                                            OnSelectedIndexChanged="ddlModelBodyCCDoor_SelectedIndexChanged">
                                                            <asp:ListItem Value="-1" Text="<%$ Resources:General,Select%>"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvModelBodyCCDoor" ControlToValidate="ddlModelBodyCCDoor"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <!-- Other Car Make Model -Start -->
                                                        <div runat="server" id="divOtherCar" style="padding: 5px 5px 5px 5px; display: none">
                                                            <asp:Label runat="server" ID="Label31" Text="<%$Resources:CarInsurance,CarMake%>"
                                                                Width="70px" />:<asp:TextBox runat="server" ID="txtOtherCarMake" Width="150px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator runat="server" ID="rfvOtherCarMake" ControlToValidate="txtOtherCarMake"
                                                                ErrorMessage="" Text="*" ValidationGroup="newmercar" Enabled="false"></asp:RequiredFieldValidator>
                                                            <br />
                                                            <br />
                                                            <asp:Label runat="server" ID="Label32" Text="<%$Resources:Proposal,CarModel%>" Width="70px" />:<asp:TextBox
                                                                runat="server" ID="txtOtherCarModel" Width="150px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator runat="server" ID="rfvOtherCarModel" ControlToValidate="txtOtherCarModel"
                                                                ErrorMessage="" Text="*" ValidationGroup="newmercar" Enabled="false"></asp:RequiredFieldValidator>
                                                            <br />
                                                            <br />
                                                            <asp:Label runat="server" ID="Label33" Text="Body" Width="70px" />:<asp:DropDownList
                                                                runat="server" ID="ddlOtherCarBody">
                                                            </asp:DropDownList>
                                                            <asp:RequiredFieldValidator runat="server" ID="rfvOtherCarBody" ControlToValidate="ddlOtherCarBody"
                                                                ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Enabled="false"></asp:RequiredFieldValidator>
                                                            <br />
                                                            <br />
                                                            <asp:Label runat="server" ID="Label34" Text="cc" Width="70px" />:<asp:TextBox runat="server"
                                                                ID="txtCcCar" Width="150px"></asp:TextBox>
                                                            <asp:RequiredFieldValidator runat="server" ID="rfvCcCar" ControlToValidate="txtCcCar"
                                                                ErrorMessage="" Text="*" ValidationGroup="newmercar" Enabled="false"></asp:RequiredFieldValidator>
                                                            <asp:RegularExpressionValidator ID="revCcCar" runat="server" ControlToValidate="txtCcCar"
                                                                Display="Dynamic" ValidationGroup="newmercar" ErrorMessage="ต้องเป็นจำนวนเต็ม"
                                                                ValidationExpression="^[1-9]\d*$" Enabled="false"></asp:RegularExpressionValidator>
                                                            <br />
                                                            <br />
                                                            <asp:Label runat="server" ID="Label35" Text="Door" Width="70px" />:<asp:DropDownList
                                                                runat="server" ID="ddlOtherCarDoor" Width="50px">
                                                                <asp:ListItem Text="2" Value="2"></asp:ListItem>
                                                                <asp:ListItem Text="3" Value="3"></asp:ListItem>
                                                                <asp:ListItem Text="4" Value="4"></asp:ListItem>
                                                                <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <!-- Other Car Make Model -End -->
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label14" Text="<%$Resources:CarInsurance,CoverCommencementDate%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlCoverageComDate" onchange="GetCoverageEndDate()" runat="server">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCoverageComDate" ControlToValidate="ddlCoverageComDate"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:Label runat="server" Visible="false" ID="lblCoverageExpireDateTitle" Text="<%$Resources:CarInsurance,CoverExpiryDate %>" />
                                                        <asp:Label runat="server" Visible="false" ID="lblCoverageExpireDate" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btnNewCar" runat="server" Width="100px" OnClick="btnNewCar_Click"
                                                            CssClass="blueB ml10" Text="New Car" OnClientClick="return ResetConfirm();" />
                                                    </td>
                                                    <td>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnSubmit" runat="server" Width="100px" OnClick="btnSubmit_Click"
                                                            ValidationGroup="newmercar" CssClass="blueB ml10" Text="<%$Resources:General,Submit%>"
                                                            OnClientClick="return SubmitLeadConfirm();" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="30" colspan="3">
                                                        <asp:Label runat="server" ID="lblMessage" Text="" Font-Bold="true" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                    <div id="divTwo" class="oneTwo">
                                        <div class="toggle">
                                            <table cellpadding="0" cellspacing="0" width="100%" border="0" class="sTable">
                                                <tr runat="server" id="divLastYearRefNo" visible="false">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label30" Text="Last Year Quote Ref.No" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblLastYearCarID" Visible="true" />
                                                        <asp:Label runat="server" ID="lblLastYearRefNo" Font-Bold="true" Font-Size="Large"
                                                            Text="N/A" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label15" Text="<%$Resources:Proposal,CurrentInsurer%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlCurrentInsurer" runat="server" Width="250px">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCurrentInsurer" ControlToValidate="ddlCurrentInsurer"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trNamedDriver" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label11" Text="<%$Resources:Proposal,NamedDrivers%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlNamedDrivers" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlNamedDrivers_SelectedIndexChanged">
                                                            <asp:ListItem Value="0" Text="<%$ Resources:Proposal,No%>"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                                            <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr id="trDriverFirstDOB" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label12" Text="<%$Resources:Proposal,DriverFirstDOB%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlDriver1DOBDay" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver1DOBDay" ControlToValidate="ddlDriver1DOBDay"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:DropDownList ID="ddlDriver1DOBMonth" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver1DOBMonth" ControlToValidate="ddlDriver1DOBMonth"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:DropDownList ID="ddlDriver1DOBYear" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver1DOBYear" ControlToValidate="ddlDriver1DOBYear"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trDriverTwoDOB" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label13" Text="<%$Resources:Proposal,DriverTwoDOB%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlDriver2DOBDay" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver2DOBDay" ControlToValidate="ddlDriver2DOBDay"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:DropDownList ID="ddlDriver2DOBMonth" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver2DOBMonth" ControlToValidate="ddlDriver2DOBMonth"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:DropDownList ID="ddlDriver2DOBYear" runat="server" Enabled="false">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvDriver2DOBYear" ControlToValidate="ddlDriver2DOBYear"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trIsCTPL" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label24" Text="<%$Resources:NonGG,IsCTPL%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlCTPL" runat="server">
                                                            <asp:ListItem Value="-1" Text="<%$ Resources:General,Select%>"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="<%$ Resources:Proposal,Yes%>"></asp:ListItem>
                                                            <asp:ListItem Value="0" Text="<%$ Resources:Proposal,No%>"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCTPL" ControlToValidate="ddlCTPL"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trModification" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label4" Text="<%$Resources:Proposal,AccessaryAndModification%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlModification" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlModification_SelectedIndexChanged">
                                                            <asp:ListItem Value="-1" Text="<%$ Resources:General,Select%>"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="<%$ Resources:Proposal,Yes%>"></asp:ListItem>
                                                            <asp:ListItem Value="0" Text="<%$ Resources:Proposal,No%>"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvModification" ControlToValidate="ddlModification"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trModificationAmount" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label16" Text="<%$Resources:Proposal,AccessaryAndModificationAmount%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtAccModAmount" runat="server" MaxLength="7" Width="100px" />
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvAccModAmount" ControlToValidate="txtAccModAmount"
                                                            ErrorMessage="" Text="*" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:RegularExpressionValidator ID="revAccModAmount" runat="server" ControlToValidate="txtAccModAmount"
                                                            Display="Dynamic" ValidationGroup="newmercar" ErrorMessage="<%$Resources:General,Notvalid%>"
                                                            ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trDEC" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label7" Text="<%$Resources:Proposal,DEC%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlDeduct" runat="server">
                                                            <asp:ListItem Text="<%$ Resources:Proposal,Option_DeductNo%>" Value="0" />
                                                            <asp:ListItem Text="<%$ Resources:Proposal,Option_DeductYes%>" Value="5000" />
                                                            <asp:ListItem Text="<%$ Resources:Proposal,Option_DeductAll%>" Value="-1" />
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr id="trProvinceRegistration" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label8" Text="<%$Resources:Proposal,RegistrationProvince%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlProvinceRegistration" Width="145px" runat="server">
                                                            <asp:ListItem Text="<%$ Resources:General,Select%>" Value="-1" />
                                                            <asp:ListItem Text="<%$ Resources:Proposal,Province_BKK%>" Value="BKK" />
                                                            <asp:ListItem Text="<%$ Resources:Proposal,Province_UPC%>" Value="UPC" />
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvProvinceRegistration" ControlToValidate="ddlProvinceRegistration"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trIsClaim" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label10" Text="<%$Resources:Proposal,IsClaim%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlAnyClaim" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlAnyClaim_SelectedIndexChanged">
                                                            <asp:ListItem Value="-1" Text="<%$ Resources:General,Select%>"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="<%$ Resources:Proposal,Yes%>"></asp:ListItem>
                                                            <asp:ListItem Value="0" Text="<%$ Resources:Proposal,No%>"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvAnyClaim" ControlToValidate="ddlAnyClaim"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr id="trNCB" runat="server">
                                                    <td width="200" height="25">
                                                        <asp:Label runat="server" ID="Label9" Text="<%$Resources:Proposal,NCB%>" />
                                                    </td>
                                                    <td>
                                                        :
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlNCB" runat="server">
                                                            <asp:ListItem Text="<%$ Resources:General,Select%>" Value="-1" />
                                                            <asp:ListItem Text="0 %" Value="0"></asp:ListItem>
                                                            <asp:ListItem Text="20 %" Value="20"></asp:ListItem>
                                                            <asp:ListItem Text="30 %" Value="30"></asp:ListItem>
                                                            <asp:ListItem Text="40 %" Value="40"></asp:ListItem>
                                                            <asp:ListItem Text="50 %" Value="50"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvNCB" ControlToValidate="ddlNCB"
                                                            ErrorMessage="" Text="*" InitialValue="-1" ValidationGroup="newmercar" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div style="display: none;">
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCallMeId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCallTypeId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtAgentLeadId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCallMeEmail"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCallMeFullName"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCallMeMobileNo"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtDriverId1" Text="0"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtDriverId2" Text="0"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCarId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCECarPolicyId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCustomerId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCXCRMId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtAgentId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtNewQuote"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtCEId"></asp:TextBox>
                                    <asp:TextBox runat="server" ReadOnly="true" ID="txtMerchantId"></asp:TextBox>
                                    <asp:Label ID="lblRedirectCarId" runat="server"></asp:Label>
                                    <asp:Label ID="lblRedirectAgentLeadId" runat="server"></asp:Label>
                                    <asp:Label ID="lblRedirectCustomerId" runat="server"></asp:Label>
                                    <asp:Label ID="lblRedirectCallTypeId" runat="server"></asp:Label>
                                </div>
                                <div id="divHiddenMonths" style="display: none;">
                                    <input runat="server" id="lblJan" type="hidden" value="<%$ Resources:MonthResource, January%>" />
                                    <input runat="server" id="lblFeb" type="hidden" value="<%$ Resources:MonthResource, February%>" />
                                    <input runat="server" id="lblMar" type="hidden" value="<%$ Resources:MonthResource, March%>" />
                                    <input runat="server" id="lblApr" type="hidden" value="<%$ Resources:MonthResource, April%>" />
                                    <input runat="server" id="lblMay" type="hidden" value="<%$ Resources:MonthResource, May%>" />
                                    <input runat="server" id="lblJun" type="hidden" value="<%$ Resources:MonthResource, June%>" />
                                    <input runat="server" id="lblJul" type="hidden" value="<%$ Resources:MonthResource, July%>" />
                                    <input runat="server" id="lblAug" type="hidden" value="<%$ Resources:MonthResource, August%>" />
                                    <input runat="server" id="lblSep" type="hidden" value="<%$ Resources:MonthResource, September%>" />
                                    <input runat="server" id="lblOct" type="hidden" value="<%$ Resources:MonthResource, October%>" />
                                    <input runat="server" id="lblNov" type="hidden" value="<%$ Resources:MonthResource, November%>" />
                                    <input runat="server" id="lblDec" type="hidden" value="<%$ Resources:MonthResource, December%>" />
                                    <input runat="server" id="lblCultureInfo" type="hidden" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </fieldset>
                </div>
            </div>
        </asp:Panel>
    </div>

    <script type="text/javascript">
        function SubmitGotoCarConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmNext")%>');
            return _retVal;
        }

        function SubmitLeadConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('newleads')) {
                _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmSubmit")%>');
            }
            else {
                ShowDiv();
            }
            return _retVal;
        }

        function SubmitConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('callstatus')) {
                _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmSubmit")%>');
            }
            //else {
            //    ShowDiv();
            //}
            return _retVal;
        }

        function NextConfirm() {
            var _retVal = false;

            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmNext")%>');

            return _retVal;
        }

        function GoNonGGQuotation() {
            var _retVal = false;

            _retVal = confirm('Are you sure to go Manual Quotation page?');

            return _retVal;
        }

        function ResetConfirm() {
            var _retVal = false;

            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmRESETMessage")%>');
            return _retVal;
        }

        function BackConfirm() {
            var _retVal = false;

            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmtoGoBack")%>');
            return _retVal;
        }

        function SubmitSelectConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmtoSelectthisItem")%>');
            return _retVal;
        }

        function GetCoverageEndDate() {
            var _commDate = document.getElementById('<%=ddlCoverageComDate.ClientID%>');
            var _expDate = document.getElementById('<%=lblCoverageExpireDate.ClientID%>');
            var now = new Date();
            var next = new Date();
            var month = new Array(12);

            month[0] = document.getElementById('<%=lblJan.ClientID%>').value;  //"January";
            month[1] = document.getElementById('<%=lblFeb.ClientID%>').value; //"February";
            month[2] = document.getElementById('<%=lblMar.ClientID%>').value; // "March";
            month[3] = document.getElementById('<%=lblApr.ClientID%>').value; // "April";
            month[4] = document.getElementById('<%=lblMay.ClientID%>').value; //"May";
            month[5] = document.getElementById('<%=lblJun.ClientID%>').value; // "June";
            month[6] = document.getElementById('<%=lblJul.ClientID%>').value; //"July";
            month[7] = document.getElementById('<%=lblAug.ClientID%>').value; //"August";
            month[8] = document.getElementById('<%=lblSep.ClientID%>').value; //"September";
            month[9] = document.getElementById('<%=lblOct.ClientID%>').value; //"October";
            month[10] = document.getElementById('<%=lblNov.ClientID%>').value; //"November";
            month[11] = document.getElementById('<%=lblDec.ClientID%>').value; //"December";

            var strCommDate = _commDate.value;
            if (strCommDate != "-1") {
                var strDay = strCommDate.substring(0, 2);
                var strMonth = strCommDate.substring(2, 4) - 1;
                var strYear = strCommDate.substring(4, 8);
                now.setFullYear(strYear, strMonth, strDay);
                next.setFullYear((parseInt(strYear) + 1).toString(), strMonth, (now.getDate()).toString());

                var strExpiryDate = next.getDate() + "/" + month[next.getMonth()] + "/" + next.getFullYear();

                if (document.getElementById('<%=lblLangOption.ClientID%>').value == '1') {
                    strExpiryDate = next.getDate() + "/" + month[next.getMonth()] + "/" + (next.getFullYear() + 543);
                }
                else {
                    strExpiryDate = next.getDate() + "/" + month[next.getMonth()] + "/" + next.getFullYear();
                }

            }
            else {
            }
        }


        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();
            OnOffUpdateProgress(true);
        }
        var dGarage = true;
        var dModification = true;
        var tAccModAmount = true;
        var dAnyClaim = true;
        var dNamedDrivers = true;
        function OnOffUpdateProgress(onOff) {
            //if ($get('<=ddlInsuranceType.ClientID>') != null) {
            //    $get('<=ddlInsuranceType.ClientID>').disabled = onOff;
            //}

            if ($get('<%=ddlGarageType.ClientID%>') != null) {
                dGarage = $get('<%=ddlGarageType.ClientID%>').disabled;
                $get('<%=ddlGarageType.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlCarYear.ClientID%>') != null) {
                $get('<%=ddlCarYear.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlCarMake.ClientID%>') != null) {
                $get('<%=ddlCarMake.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlModelBodyCCDoor.ClientID%>') != null) {
                $get('<%=ddlModelBodyCCDoor.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlModification.ClientID%>') != null) {
                dModification = $get('<%=ddlModification.ClientID%>').disabled;
                $get('<%=ddlModification.ClientID%>').disabled = onOff;
            }

            if ($get('<%=txtAccModAmount.ClientID%>') != null) {
                tAccModAmount = $get('<%=txtAccModAmount.ClientID%>').disabled;
                $get('<%=txtAccModAmount.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlAnyClaim.ClientID%>') != null) {
                dAnyClaim = $get('<%=ddlAnyClaim.ClientID%>').disabled;
                $get('<%=ddlAnyClaim.ClientID%>').disabled = onOff;
            }
            if ($get('<%=ddlNamedDrivers.ClientID%>') != null) {
                dNamedDrivers = $get('<%=ddlNamedDrivers.ClientID%>').disabled;
                $get('<%=ddlNamedDrivers.ClientID%>').disabled = onOff;
            }

            if ($get('<%=ddlCoverageComDate.ClientID%>') != null) {
                $get('<%=ddlCoverageComDate.ClientID%>').disabled = onOff;
            }

            if ($get('<%=btnSubmit.ClientID%>') != null) {
                $get('<%=btnSubmit.ClientID%>').disabled = onOff;
            }

            if ($get('<%=btnNewCar.ClientID%>') != null) {
                $get('<%=btnNewCar.ClientID%>').disabled = onOff;
            }

            if ($get('<%=lblLoadMessage.ClientID%>') != null) {
                if (onOff) {
                    $get('<%=lblLoadMessage.ClientID%>').innerHTML = 'Processing... please wait';
                }
            }

        }

        function EndRequest(sender, args) {
            OnOffUpdateProgress(false);
            if ($get('<%=ddlGarageType.ClientID%>') != null) {
                $get('<%=ddlGarageType.ClientID%>').disabled = dGarage;
            }
            if ($get('<%=ddlModification.ClientID%>') != null) {
                $get('<%=ddlModification.ClientID%>').disabled = dModification;
            }
            if ($get('<%=txtAccModAmount.ClientID%>') != null) {
                $get('<%=txtAccModAmount.ClientID%>').disabled = tAccModAmount;
            }
            if ($get('<%=ddlAnyClaim.ClientID%>') != null) {
                $get('<%=ddlAnyClaim.ClientID%>').disabled = dAnyClaim;
            }
            if ($get('<%=ddlNamedDrivers.ClientID%>') != null) {
                $get('<%=ddlNamedDrivers.ClientID%>').disabled = dNamedDrivers;
            }
        }

    </script>

</asp:Content>
